use(["public/javascripts/service/errorPageService.js"], function(errorPageService) {
    var PageComponent = React.createClass({
        componentDidMount: function() {
            var code = this.state.data.code;
            this.setState({
                errorMsgBody: {
                    height: '100%',
                    background: 'url(../../images/' + code + '.gif)  center no-repeat',
                },
            });
            this.changeErrorText(code);
        },
        changeErrorText: function(code) {
            var text = '';
            switch (parseInt(code)) {
                case 401:
                    text = '哎呦，不小心走丢了...';
                    break;
                case 403:
                    text = '权限不足，不能访问呢...';
                    break;
                case 404:
                    text = '找不到您要的页面呢...';
                    break;
                default:
                    text = '服务器开小差了...';
                    break;
            }
            this.setState({
                errorText: text,
            });
        },
        receiveMsg: function(data) {

        },
        getInitialState: function () {
            return this.props ? this.props : {};
        },
        render:function() {
            var data = this.state.data;
            return ~init;
        }
    });
    if(typeof ReactDOM != "undefined") {
        ReactDOM.render(<PageComponent data={storage}/>, document.getElementById('container'));
    }
    module.exports = PageComponent;
});